package com.jinghao.tws.controller;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.jinghao.core.common.controller.JingHaoBaseController;
import com.jinghao.tws.entity.WvPallet;
import com.jinghao.tws.entity.WvProcessConfig;
import com.jinghao.tws.service.IWvPalletService;

@Controller
@Scope("prototype")
@RequestMapping(value = "/app/tws/WvPallet")
public class WvPalletController extends JingHaoBaseController<WvPallet> {
	//==================定制内容开始======================
//在这里修改代码
	/**
	 * 新增托盘信息
	 * @param  
	 */
	@ResponseBody
	@RequestMapping(value = "/save",method = RequestMethod.POST) 
	public Map<String, Object> addWmsInfo(@RequestBody Map<String,Object> map){
		this.getWvPalletService().addWmsInfo(map);
        return new WvPallet().getJson();   
	} 
	/**
	 * 列出所有托盘信息
	 * @param  
	 */
	@ResponseBody
	@RequestMapping(value = "/listAll",method = RequestMethod.GET) 
	public Map<String, Object> listAllWvPallet(@ModelAttribute("model") WvPallet model){
		this.getWvPalletService().listAllWvPallet(model);
        return model.getListJson();   
	} 
	/**
	 * 统计每天托盘数据
	 * @param  
	 */
	@ResponseBody
	@RequestMapping(value = "/listAllWvPalletTJ",method = RequestMethod.GET) 
	public Map<String, Object> listAllWvPalletTJ(@ModelAttribute("model") WvPallet model){
		this.getWvPalletService().listAllWvPalletTJ(model);
        return model.getListJson();   
	} 
	/**
	 * 更新视频地址信息
	 * @param  
	 */
	@ResponseBody
	@RequestMapping(value = "/updateWvPalletUrlLink",method = RequestMethod.POST) 
	public Map<String, Object> updateWvFlowUrlLink(@ModelAttribute("model") WvPallet model,@RequestBody Map<String,Object> map){
		model.setObjMap(map);
		this.getWvPalletService().updateWvPalletUrlLink(model);
        return model.getJson();   
	}
	/**
	 * 生成合并视频 
	 * @param  
	 */
	@ResponseBody
	@RequestMapping(value = "/updateGenerateVedio",method = RequestMethod.GET) 
	public Map<String, Object> updateGenerateVedio(@ModelAttribute("model") WvPallet model){
		this.getWvPalletService().updateGenerateVedio(model);
        return model.getSingleJson();   
	}
	/**
	 * 重新生成所有合并视频 
	 * @param  
	 */
	@ResponseBody
	@RequestMapping(value = "/updateReSetAllGenerateVedio",method = RequestMethod.GET) 
	public Map<String, Object> updateReSetAllGenerateVedio(@ModelAttribute("model") WvPallet model){
		this.getWvPalletService().updateReSetAllGenerateVedio(model);
        return model.getSingleJson();   
	}
	/**
	 * 停止生成视频 
	 * @param  
	 */
	@ResponseBody
	@RequestMapping(value = "/updateStopGenerateVideo",method = RequestMethod.GET) 
	public Map<String, Object> updateStopGenerateVideo(@ModelAttribute("model") WvPallet model){
		this.getWvPalletService().updateStopGenerateVideo(model);
        return model.getSingleJson();   
	}
	//==================定制内容结束======================

	@Autowired
	public void setWvPalletService(IWvPalletService wvPalletService) {
		super.setIJingHaoBaseService(wvPalletService);
	}

	public IWvPalletService getWvPalletService() {
		return (IWvPalletService) super.getIJingHaoBaseService();
	}
}
